<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <title>码匠社区 - 个人中心</title>
    <title th:replace="head :: htmlHead"></title>
</head>
<body>
<div th:insert="navigation :: headBar"></div>
<div class="container-fluid main">
    <div class="row">
        <div class="col-lg-9 col-sm-12">
            <h2 style="display: flex" th:text="${sectionName}"></h2>
            <hr>
            <!--        我的问题模块-->
            <div th:if="${section} == 'question'">
                <div class="list-group">
                    <a  th:href="@{'/question/' + ${question.id}}" class="list-group-item btn" style="margin-bottom: 5px;text-align: start" th:each="question : ${questionList}">
                        <h5 th:text="${question.title}"></h5>
                        <span style="font-size: 12px;color: #999999">[[${#dates.format(question.gmtModify,'yyyy MMMM dd日 HH:mm')}]]</span>
                    </a>
                </div>
                <nav aria-label="Page navigation">
                    <ul class="pager">
                        <li class="previous"><a th:href="@{'/profile/'+ ${section}(page=(${page} - 1))}" th:if="${page} &gt; 1"><span aria-hidden="true">&larr;</span> Next</a></li>
                        <li class="next"><a th:href="@{'/profile/'+ ${section}(page=(${page} + 1))}" th:if="${page} &lt; ${pageCount}">Prev <span aria-hidden="true">&rarr;</span></a></li>
                    </ul>
                </nav>
            </div>
            <!--        最新回复模块-->
            <div th:if="${section} == 'replies'">
                <div class="list-group" style="font-weight: bolder">
                    <li class="list-group-item" th:each="notification : ${notificationDtoList}">
                        <span class="label label-danger" th:if="${notification.status == 0}">未读</span>
                        <span th:text="${notification.notifierName}"></span>
                        <span th:text="${notification.hint}"></span>
                        <a th:href="@{/notification/read/(questionId=${notification.notifierQuestionId},notificationId=${notification.id},receiverId=${notification.receiver})}" th:text="${notification.notifierTitle}"></a>
                        <p class="pull-right" style="font-size: 12px;color: #999999;margin-bottom: 0">[[${#dates.format(notification.gmtCreate,'yyyy MMMM dd日 HH:mm')}]]</p>
                    </li>
                </div>
            </div>
        </div>
        <div class="col-lg-3 col-sm-12">
            <div class="list-group" style="margin-top: 30px;">
                <a href="/profile/question" class="list-group-item" th:classappend="${section} == 'question'? 'active' : '' ">我的问题</a>
                <a href="/profile/replies" class="list-group-item" th:classappend="${section} == 'replies'? 'active' : '' ">最新回复</a>
            </div>
        </div>
    </div>
</div>
</body>
</html>